package com.lty.zyq.controller;


import com.lty.zyq.entity.User;
import com.lty.zyq.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

//    @GetMapping("/")
//    List<User> getUserList(){
//        return userDao.findAll();
//    }

    @PostMapping("/_hasUser")
    Integer hasUser(@RequestBody User user) {
        return userService.hasUser(user);
    }

    @PostMapping("/")
    User saveUser(@RequestBody User user) {
        return userService.getUser(user);
    }




}
